home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 2432 < prev    next >
Encoding:
Text File  |  1996-08-05  |  2.1 KB  |  57 lines

  1. Newsgroups: comp.lang.misc,comp.lang.perl.misc,comp.lang.tcl,comp.lang.c,comp.lang.java
  2. Path: munta.cs.mu.OZ.AU!fjh
  3. From: fjh@munta.cs.mu.OZ.AU (Fergus Henderson)
  4. Subject: Re: Relative Speed of Perl vs. Tcl vs. C
  5. Message-ID: <9602122.8425@mulga.cs.mu.OZ.AU>
  6. Sender: news@cs.mu.OZ.AU (CS-Usenet)
  7. Organization: Computer Science, University of Melbourne, Australia
  8. References: <4dhuoj$cbe@shellx.best.com>
  9. Date: Sun, 21 Jan 1996 11:16:56 GMT
  10.  
  11. yogi@shellx.best.com (Yogi) writes:
  12.  
  13. >Can't seem to find any info on statements I have read that seem to conflict:
  14.  
  15. Have you ever heard the phrase "Lies, damned lies, and benchmarks"?
  16.  
  17. >Somewhere I have read that Perl coded grep runs as fast or faster than C
  18. >coded grep in Unix. (Larry Wall wrote this, correct me if I'm wrong.)
  19.  
  20. Sounds quite likely to be true.
  21. For this specific task, Perl could easily be as fast as C.
  22.  
  23. >And in a CGI-web book I read that Perl is an interpreted language that runs
  24. >10 times slower than C.
  25.  
  26. For most programs, that is probably true.
  27.  
  28. >But Perl is compiled, right?
  29.  
  30. Sort of.  Perl code gets compiled to a bytecode which is then interpreted.
  31.  
  32. >So how is that different
  33. >than say, the Tcl interpreter?
  34.  
  35. It's much more efficient.
  36.  
  37. >So what's the real answer, or are both statements true somehow? I know that
  38. >Perl can run faster or slower depending on how you code it, (C too) and 
  39. >so I guess you would have to find the fastest C code for a particular function
  40. >and similar fastest Perl code (or Tcl) and compare THOSE programs to get 
  41. >a definative answer.
  42.  
  43. That's right, although even then the answers will no doubt be subject
  44. to much debate.  I'm afraid that obtaining a genuinely definitive
  45. answer on questions like this is prohibitively expensive.
  46.  
  47. >And then, what about the speed of Java in comparison to the other 3?
  48.  
  49. The currently available implementation of Java uses the same basic
  50. technology (compiling to bytecodes) as Perl, so performance is likely
  51. to be pretty similar.  But Java is probably much easier to write
  52. an efficient native-code compiler for.
  53.  
  54. --
  55. Fergus Henderson                 WWW: http://www.cs.mu.oz.au/~fjh
  56. fjh@cs.mu.oz.au                  PGP: finger fjh@128.250.37.3
  57.